WRANGLERS

Knife Crime

A range plot showing trend direction

Photo by Snehal Krishna on Unsplash

Photo by Snehal Krishna on Unsplash

Remember, it is never the knife’s fault…
— Daniel Boulud


Ingest

area, year, trend

df = read.csv("archetypes/knife-crime/knife-crime.csv", header = TRUE, stringsAsFactors = TRUE)
df

Wrangle

filter for rising and declining

df_rising <- filter(df, color == "Increase in knife crimes")
df_declining <- filter(df, color == "Decrease in knife crimes")

Plot

Where is knife crime rising?

theme_opts <- theme(
    panel.grid.major.x = element_blank(),
    panel.grid.major.y = element_blank(),
    panel.grid.minor.x = element_blank(),
    panel.grid.minor.y = element_blank(),
    axis.ticks = element_line(),
    legend.position = "none"
  )

v1 = ggplot(df_rising) + 
  geom_point(aes(x=X2017, y=factor(Area.Name)), shape=16, alpha=1.0, size=2, color="#a82e13") +
  geom_segment(aes(x=X2017, y=factor(Area.Name), xend=X2018, yend=factor(Area.Name)), 
               lineend = "round", linejoin = "round", size=1, color="#a82e13") + 
  geom_text(aes(x=X2018, y=Area.Name), label = "\u25B6", size = 12, color="#a82e13", vjust = 0.55) + 
  scale_x_continuous() +
  scale_y_discrete() +
  labs(title = "Where is knife crime rising?") +
  theme_minimal() +
  theme_opts +
  xlab(NULL) +
  ylab(NULL)

girafe(ggobj = v1, width_svg = 1280/72, height_svg = 720/72,
       options = list(opts_sizing(rescale = TRUE, width = 1.0)))

Plot

Where is knife crime decreasing?

v2 = ggplot(df_declining) + 
  geom_point(aes(x=X2017, y=factor(Area.Name)), shape=16, alpha=1.0, size=2, color="#63a0cd") +
  geom_segment(aes(x=X2017, y=factor(Area.Name), xend=X2018, yend=factor(Area.Name)), size=1, color="#63a0cd") + 
  geom_text(aes(x=X2018, y=Area.Name), label = "\u25C0", size = 12, color="#63a0cd", vjust = 0.55) + 
  scale_x_continuous() +
  scale_y_discrete() +
  labs(title = "Where is knife crime decreasing?") +
  theme_minimal() +
  theme_opts +
  xlab(NULL) +
  ylab(NULL)

girafe(ggobj = v2, width_svg = 1280/72, height_svg = 720/72,
       options = list(opts_sizing(rescale = TRUE, width = 1.0)))

References

citations for narrative and data sources

Inspiration: Datawrapper, Where is knife crime rising?, https://blog.datawrapper.de/weekly-chart-range-plot-the-times-ryan-watts/ Data Source: Office for National Statistics